package com.example.demo.modules.base.service;

import com.example.demo.base.XbootBaseService;
import com.example.demo.modules.base.entity.User;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * 用户接口
 * @author yw
 */
@CacheConfig(cacheNames = "user")
public interface UserService extends XbootBaseService<User,Integer> {

    /**
     * 通过用户名获取用户
     * @param username
     * @return
     */
    @Cacheable(key = "#username")
    User findByUsername(String username);

}